The simplest query uses
one operator to search one field for a certain value. The range
query searches one field to return records that fall within a range you
specify.
The Quick Query Tab
The Quick Query tab is designed to familiarize
you with query syntax as quickly as possible. Constructing a quick
query involves selecting a field from the current database table,
applying a conditional operator to it, and
specifying a value for the field.
Conditional operators are constraints such
as equal, greater than, or less than. The following table summarizes
the Quick Query tab's operators.
Query
Operators
Query Operators
|
Operator
|
Description
|
Equal (=)
|
Returns all records that exactly match the value
that you specify.
|
Not equal (<>)
|
Returns all records except those matching the
value that you specify.
|
Greater than (>)
|
Returns all records that exceed the value that
you specify.
|
Less than (<)
|
Returns all records with values that are less
than the value that you specify.
|
Greater than or equal (>=)
|
Returns all records that exceed or equal the
value that you specify.
|
Less than or equal (<=)
|
Returns all records that are less than or equal
to the value that you specify.
|
Like
|
Returns all records that contain the value that
you specify. Using the like operator, you can specify the optional
% wild-card character. If, for example, you want to return all records
that end with the string "ert", you enter the value %ert.
If you want to return all records that begin with the string "ert", you
enter the value ert%. If you don't specify the
% wild-card character, the program searches for the exact value
that you specify.
|
In
|
Returns all records that match a set of values
that you specify. If, for example, you are searching for an employee
record but are not sure if the name is spelled Smith or Smythe,
you could issue the in operator and provide both spelling values
to return all records spelled either Smith or Smythe.
The two values must be separated by a comma.
|
Is null
|
Returns all records that do not have values
specified for the field that you're querying. This operator is useful
for locating records in your database table that are missing data.
|
Is not null
|
Returns all records that have values specified
for the field that you're querying. This operator is useful for
excluding from your query any records in your database table that
are missing data.
|
NoteAll operators can
be applied to both numeric and text-based fields. For example, you
can search for all records greater than "c", which would return
all records ranging from "ca..." through "z...". It is important
to realize that query searches are case sensitive: "ROOM" is not
equivalent to "room".
The Range Query Tab
Like the Quick Query tab, the Range Query tab
is designed to assist users who are new to working with database
queries. Using the Range Query tab, you can specify a range of values
for the query to return: for example, all rooms that are greater
than or equal to 80 square feet but are less than or equal to 100
square feet. The interface is similar to that of the Quick Query
tab, except the Operator field has been removed and the Value field
has been replaced with two fields: a From field and a Through field.
All other interface features are available and work as they do on
the Quick Query tab.
To construct a quick query
- Open the Query Editor as described in
To open the Query Editor.
- On the Quick Query tab, select a field
from the Field list.
- Select an operator from the Operator
list.
- Enter a value in the Value field, or
click Look Up Values.
Look Up Values returns
a list of all values for the specified field from the database table,
so you can select the value that you want. After selecting a value,
click OK.
- Select one or both of the following:
- Indicate Records in Data
View. Highlights records that match
your query in the Data View window.
- Indicate Objects in Drawing. Highlights
objects that match your query in the current drawing.
- If you want to save the query in the
current drawing for future use, click Store.
- Click Execute to execute the query and
close the dialog box.
A subset of records that
match your query criterion are displayed in the Data View window.
To return to the Query Editor to refine your query, click the Return
to Query button.
To construct a range query
- Open the Query Editor as described in
To open the Query Editor.
- On the Range Query tab, select a field
from the Field list.
- Enter a value in From, or click Look
Up Values (From).
Look Up Values displays
a list of all values for the specified field from the database table,
so you can select the value that you want. After selecting a value,
click OK.
The query searches for
all values greater than or equal to the value that you specify.
- Enter a value in Through, or click Look
Up Values (Through).
The query searches for
all values less than or equal to the value that you specify.
- If you want to save the query in the
current drawing for future use, click Store.
- Click Execute to execute the query and
close the dialog box.
CommandsDBCONNECT
Provides an interface
to external database tables.